﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using zic_dotnet.Domain;

namespace stackFluent.Domain {
    public class Tech : IAggregateRoot {
        [Key]
        public Guid ID { get; set; }
        public int ActId { get; set; }
        public DateTime DateCreated { get; set; }
        public int CategoryId { get; set; }
        public virtual Category Category { get; set; }

        [Required]
        [MaxLength(50)]
        public string Name { get; set; }

        [MaxLength(150)]
        public string HomePage { get; set; }
        //使用Js管理多条link
        [MaxLength(150)]
        public string Links { get; set; }
        //基本描述wiki形式管理，由关注者提出新版本+投票，高阶关注者投票权重更大
        public string Description { get; set; }

        public int LicenseId { get; set; }
        public int ApplicationValue { get; set; }
        public int CommunityValue { get; set; }
        public int QualityValue { get; set; }

        [Timestamp]
        public Byte[] Timestamp { get; set; }

        //关注它的users，与User表多对多关系
        public virtual ICollection<RelaUserTech> InteredUsers { get; set; }
        public virtual ICollection<RelaTechSite> RelaSites { get; set; }
        public virtual ICollection<RelaTechTech> DependentTechs { get; set; }
        public virtual ICollection<RelaTechTech> BeDependentTechs { get; set; }

        //问答社区nuget
        public virtual ICollection<Question> Questions { get; set; }
        //资源发布社区
        public virtual ICollection<Resource> Resources { get; set; }
    }
}